<template>
    <div class>
        <div class="head">
            <img src="../../../static/images/my.png" class="userhead"/>
            <p class="username">{{userInfo.nickname}}</p>
        </div>
        <div class="item">
            <ul class="menu">
                <li @click="resetPwd">
                    <i class="iconfont">
                        <img src="../../../static/images/pas.png"/>
                    </i>
                    <span>修改密码</span>
                    <img class="float-right" style="padding:0.35rem 0.6rem 0 0 ;"
                         src="../../../static/images/img-left.png" width="22"/>
                </li>
                <li @click="toProblem">
                    <!-- <i class="iconfont icon2">&#xe71f;</i> -->
                    <i class="iconfont icon2">
                        <img src="../../../static/images/ques.png"/>
                    </i>
                    <span>常见问题</span>
                    <img class="float-right" style="padding:0.35rem 0.6rem 0 0 ;"
                         src="../../../static/images/img-left.png" width="22"/>
                </li>
                <li @click="toAboutUs">
                    <!-- <i class="iconfont icon3">&#xe629;</i> -->
                    <i class="iconfont icon3">
                        <img src="../../../static/images/abs.png"/>
                    </i>
                    <span>关于我们</span>
                    <img class="float-right" style="padding:0.35rem 0.6rem 0 0 ;"
                         src="../../../static/images/img-left.png" width="22"/>
                </li>
            </ul>
        </div>
        <!--<div class="userbtn">-->
            <!--<button class="weui-btn weui-btn_primary" @click="logout">退出</button>-->
        <!--</div>-->
        <div class="btn-next-block" @click="logout()">
            <button class="btn-next weui-btn btn-check">退出</button>
        </div>

        <common-footer></common-footer>
    </div>
</template>

<script>
    import login from '../../services/login'

    export default {
        data() {
            return {
                userInfo:JSON.parse(this.$tools.getMessage('userInfo'))
            };
        },
        name:'userInfo',
        component: {},
        methods: {
            // 退出登录
            logout() {
                let _param = this.$tools.invokeUAF('user/logout', {});
                login.logout(_param).then(res => {
                    this.$tools.goPage('login')
                })
            },

            //修改密码
            resetPwd() {
                this.$router.push("/userInfo/resetPwd");
            },
            //常见问题
            toProblem() {
                this.$router.push("/userInfo/problems");
            },
            //关于我们
            toAboutUs() {
                this.$router.push("/userInfo/aboutUs");
            }
        }
    };
</script>


<style lang="less" rel="stylesheet/less" type="text/less" scoped>
    .head {
        width: 100%;
        height: 4rem;
        background-image: url(../../../static/images/userbg_02.png);
        position: relative;
        padding: 0 0.4rem;
        line-height: 4rem;
        display: flex;
        align-items: center;
    }

    .userhead {
        width: 1.68rem;
        height: 1.68rem;
        border: 2px solid #640ff1;
        border-radius: 50%;
    }

    .username {
        font-size: 0.48rem;
        color: #fff;
        margin-left: 0.266667rem;
    }

    .menu {
        width: 100%;
        height: auto;
        background: #fff;

        li {
            height: 1.253333rem;
            line-height: 1.253333rem;
            width: 100%;
            border-bottom: 1px solid #e2e2e2;
            padding: 0 0.4rem;
            font-size: 0.48rem;
            position: relative;

            .iconfont {
                font-size: 0.48rem;
                margin-right: 0.266667rem;
                color: #21d9c5;

                &.icon2 {
                    color: #46b9f3;
                }

                &.icon3 {
                    color: #ff8084;
                }

                &.r-icon {
                    position: absolute;
                    right: 0.1rem;
                    font-size: 0.7rem;
                    color: #c0c0c5;
                }
            }
        }
    }

    li i img {
        width: 16px !important;
        vertical-align: -0.106667rem;
    }

    .userbtn {
        margin-top: 1rem;
        padding: 0 0.4rem;
    }

    .weui-btn_primary {
        width: 92%;
        background-color: #6c84e5 !important;
    }
</style>
